package cn.cyh.imeans.enums;

/**
 * 车牌颜色
 */
public enum PlateColorEnum {
    /**车牌颜色**/
    WHITE("0", "白色"),
    YELLOW("1", "黄色"),
    BLUE("2", "蓝色"),
    BLACK("3", "黑色"),
    AGRICULTURAL_GREEN("4", "农用绿"),
    OTHER("9", "其它"),
    YELLOW_GREEN("51", "黄绿"),
    GREEN("52", "绿")
    ;

    private String value;
    private String label;
    PlateColorEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public static String getValueByLabel(String label) {
        if(label == null || "".equals(label)) {
            return PlateColorEnum.OTHER.value;
        }
        for (PlateColorEnum value : PlateColorEnum.values()) {
            if(value.label.equals(label) || value.label.contains(label)) {
                return value.value;
            }
        }
        return PlateColorEnum.OTHER.value;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }
}
